#include <cstdio>
#include <functional>
#include <algorithm>

using namespace std;

int score[100005];

int main()
{
    int n, cnt = 0;
    scanf("%d", &n);
    for(int i = 0; i < n; i++) {
        scanf("%d", &score[i]);
    }

    std::sort(score, score+n, greater<int>());
    printf("%d ", score[(n-1) / 2]);  // 分数线

    for(int i = 0; i < n; i++) {
        if(score[i] >= score[(n-1) / 2]) {
            cnt++;
        } else {
            break;
        }
    }

    printf("%d\n", cnt);

    return 0;
}
